package com.sf.osms.dep.processor.util;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;

import com.sf.osms.dep.cache.SysConfigCacheHelper;

public class SytermConfigUtil {
	
	public static final Map<String,String> defaultConfig;
	static{
		defaultConfig = new HashMap<String, String>();
		defaultConfig.put("systerm_name", "ASURA-OSMS-SERVER");
	}
	
	public static String getConfigValue(String key){
		/*Properties prop = AppContext.getContext().getConfigProperties();*/
		String fvpAddress = "";
		try {
			fvpAddress = SysConfigCacheHelper.getSysConfigValue(key);
		} catch (Exception e) {
			fvpAddress = "";
		}
		
		if(StringUtils.isEmpty(fvpAddress)){
			fvpAddress = defaultConfig.get(key);
		}
		
		return fvpAddress.trim();
	}
}
